package com.scujj.cs6.model.dto.user;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

@Schema(name = "用户信息更新" , description = "用户信息更新DTO，如果不需要更新某个字段，不要传")
@Data
public class UserInfoUpdateDTO {

    @Schema(description = "用户名", example = "张三")
    @NotNull(message = "用户名不能为空")
    private String username;

    @Schema(description = "邮箱")
    @Email(message = "邮箱格式不正确")
    @NotNull(message = "邮箱不能为空")
    private String email;

    @Schema(description = "手机号")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式错误")
    @NotNull(message = "手机号不能为空")
    private String phone;
}
